Bug 10695

Summary: sqlite: upstream performance problem
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Patrick Ohly <patrick.ohly>
Component: coreAssignee: Maxin B. John <maxin.john>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: maxin.john, meta.mr.watcher, meta.watcher, ross.burton, sgw
Version: 2.3   
Target Milestone: 2.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Correspondence with Sqlite3 team none

Description Patrick Ohly 2016-11-21 12:53:57 UTC
Patch https://patchwork.openembedded.org/patch/132885/ reverted an upstream patch in sqlite which caused a performance regression (see bug #10367).

As discussed in response to that patch, upstream needs to be notified about that problem and either also needs to revert the patch or find some other solution for whatever they were trying to achieve in the first place.

If we don't do that, updating to future versions of sqlite will be hard.
Comment 1 Jianxun Zhang 2017-01-04 01:51:04 UTC
I have sent an email to sqlite user mailing list, CCing Patrick, pseudo maintainer and Saul.
Comment 2 Jianxun Zhang 2017-01-05 19:31:32 UTC
Created attachment 3588 [details]
Correspondence with Sqlite3 team
Comment 3 Jianxun Zhang 2017-01-05 19:39:03 UTC
Refer to the attached correspondence between us and Sqlite3 team. Although the fix is in 3.16.0 but we are suggested to wait for 3.16.2 release which should come out very soon.

I think once the Sqlite 3 component in YP is updated to 3.16.2 or any newer versions than it we can re-benchmark without the reverting patch then decide the next to do.

Add maxin.john@intel.com the maintainer of sqlite 3 in watch list.

Thanks
Comment 4 Maxin B. John 2017-01-11 10:03:24 UTC
(In reply to comment #3)
...
> I think once the Sqlite 3 component in YP is updated to 3.16.2 or any newer
> versions than it we can re-benchmark without the reverting patch then decide
> the next to do.
> 
> Add maxin.john@intel.com the maintainer of sqlite 3 in watch list.
> 

Patch for sqlite3 version upgrade to 3.16.2 sent to oe-core mailing list: 

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ross/mut&id=41b9dd7ddc0b270638ccfb57429d355b1eea5276
Comment 5 Jianxun Zhang 2017-01-11 20:32:39 UTC
Maxin.
Thanks lot!
BTW, did you have any chance to verify no performance regression with the new version in the patch?
Comment 6 Maxin B. John 2017-01-12 09:38:03 UTC
(In reply to comment #5)
> Maxin.
> Thanks lot!
> BTW, did you have any chance to verify no performance regression with the
> new version in the patch?

# /usr/bin/time -v bitbake core-image-minimal

Without the upgrade:

Summary: There were 2 WARNING messages shown.
	Command being timed: "bitbake core-image-minimal"
	User time (seconds): 11889.38
	System time (seconds): 3087.18
	Percent of CPU this job got: 300%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 1:23:08
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 802816
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 7888
	Minor (reclaiming a frame) page faults: 721841293
	Voluntary context switches: 19513415
	Involuntary context switches: 5332647
	Swaps: 0
	File system inputs: 5243800
	File system outputs: 54152904
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

After upgrade:

Summary: There were 2 WARNING messages shown.
	Command being timed: "bitbake core-image-minimal"
	User time (seconds): 12026.36
	System time (seconds): 3064.97
	Percent of CPU this job got: 341%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 1:13:40
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 802860
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 7551
	Minor (reclaiming a frame) page faults: 721237606
	Voluntary context switches: 17455269
	Involuntary context switches: 7620493
	Swaps: 0
	File system inputs: 5461224
	File system outputs: 53941600
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0

In addition to this, Ross mentioned that this upgrade will be tested on performance cluster before pushing to master.
Comment 7 Saul Wold 2017-01-12 16:45:59 UTC
Can this patch be tested also with the Ostro failing issue, I know it's not being supported, but it did show the worst performance regression.
Comment 8 Ross Burton 2017-01-26 16:39:24 UTC
Upstream fixed this in 3.16.2, merged in oe-core 05317fe9f11565d40b84ad71300b39c990a53f6d.