Click here to Skip to main content
15,888,610 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Performance woes. I'm appalled. Pin
trønderen26-Dec-20 9:01
trønderen26-Dec-20 9:01 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 10:19
mvahoney the codewitch26-Dec-20 10:19 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 16:57
mvahoney the codewitch26-Dec-20 16:57 
GeneralRe: Performance woes. I'm appalled. Pin
trønderen26-Dec-20 18:50
trønderen26-Dec-20 18:50 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 0:55
mvahoney the codewitch27-Dec-20 0:55 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 1:05
mvahoney the codewitch27-Dec-20 1:05 
GeneralRe: Performance woes. I'm appalled. Pin
Josh Gray228-Dec-20 1:47
Josh Gray228-Dec-20 1:47 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch28-Dec-20 2:02
mvahoney the codewitch28-Dec-20 2:02 
I like to do broad, algorithmic optimizations before I try to outsmart the compiler.

I've gotten at least a 3 times speed improvement by changing my parsing to use strpbrk() over a memory mapped file. Big Grin | :-D

Approx stack size of local JSON stuff is 176 bytes
Read 1231370 nodes and 20383269 characters in 268.944000 ms at 70.646677MB/s
Skipped 1231370 nodes and 20383269 characters in 35.784000 ms at 530.963559MB/s
utf8 scanned 20383269 characters in 78.679000 ms at 241.487563MB/s
raw ascii i/o 20383269 characters in 58.141000 ms at 326.791765MB/s
raw ascii block i/o 19 blocks in 3.369000 ms at 5639.655684MB/s


The bold is the relevant line here. That's doing a parse of the bones of the document (looking for {}[]") in order to skip over it in a structured way. That style of parsing is used for searching, for example, when you're trying to find all ids in a document. It's using the mmap technique i mentioned.

Here's snagging all "id" fields out of a 20MB file and reading their values.

Approx stack size of local JSON stuff is 152 bytes
Found 40008 fields and scanned 20383269 characters in 34.664000 ms at 548.119086MB/s


The bytes used stuff is roughly how much memory the query takes - including the sizes of the JsonReader and LexSource member variables.
Real programmers use butterflies

GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 3:45
professionalJörgen Andersson27-Dec-20 3:45 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 4:07
mvahoney the codewitch27-Dec-20 4:07 
GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 4:13
professionalJörgen Andersson27-Dec-20 4:13 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 4:31
mvahoney the codewitch27-Dec-20 4:31 
GeneralRe: Performance woes. I'm appalled. Pin
Jörgen Andersson27-Dec-20 4:51
professionalJörgen Andersson27-Dec-20 4:51 
GeneralRe: Performance woes. I'm appalled. Pin
Gerry Schmitz26-Dec-20 15:19
mveGerry Schmitz26-Dec-20 15:19 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch26-Dec-20 16:49
mvahoney the codewitch26-Dec-20 16:49 
GeneralRe: Performance woes. I'm appalled. Pin
k505427-Dec-20 3:34
mvek505427-Dec-20 3:34 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch27-Dec-20 3:56
mvahoney the codewitch27-Dec-20 3:56 
GeneralRe: Performance woes. I'm appalled. Pin
obermd28-Dec-20 3:45
obermd28-Dec-20 3:45 
GeneralRe: Performance woes. I'm appalled. Pin
honey the codewitch28-Dec-20 3:47
mvahoney the codewitch28-Dec-20 3:47 
GeneralFun with Java Pin
Cp-Coder25-Dec-20 13:09
Cp-Coder25-Dec-20 13:09 
GeneralRe: Fun with Java Pin
Richard MacCutchan25-Dec-20 21:12
mveRichard MacCutchan25-Dec-20 21:12 
GeneralRe: Fun with Java Pin
Amarnath S26-Dec-20 2:17
professionalAmarnath S26-Dec-20 2:17 
GeneralRe: Fun with Java Pin
Mike Hankey26-Dec-20 3:07
mveMike Hankey26-Dec-20 3:07 
GeneralRe: Fun with Java Pin
Gary R. Wheeler26-Dec-20 8:46
Gary R. Wheeler26-Dec-20 8:46 
GeneralRe: Fun with Java Pin
Mike Hankey26-Dec-20 9:01
mveMike Hankey26-Dec-20 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.